//demo.js
const viewer = new Cesium.Viewer('cesiumContainer');
viewer.scene.globe.showGroundAtmosphere = false;
let instance = daas.useCesium(viewer);
//增
let layer = instance.addLayer({
    name: '影像',
    index: 0,
    subdomains: '123',
    baseUrl: "https://tiles{s}.geovisearth.com/base/v1/img/{z}/{x}/{y}",
    tmsIds: "w",
    format:'webp',
    token: "ce9aca38d2ffd820d67512267b08dfa7aad649ec039dc7d4d36b70c8d920dde0",
    minimumLevel: 0,
    maximumLevel: 18,
});

let yxzjLayer = instance.addLayer({
    name: '影像注记',
    index: 1,
    subdomains: '123',
    baseUrl: "https://tiles{s}.geovisearth.com/base/v1/cia/{z}/{x}/{y}",
    tmsIds: "w",
    format:'webp',
    token: "ce9aca38d2ffd820d67512267b08dfa7aad649ec039dc7d4d36b70c8d920dde0",
    minimumLevel: 0,
    maximumLevel: 18
});

let vecLayer = instance.addLayer({
    name: '矢量图',
    index: 2,
    subdomains: '123',
    baseUrl: "https://tiles{s}.geovisearth.com/base/v1/vec/{z}/{x}/{y}",
    tmsIds: "w",
    format:'webp',
    token: "ce9aca38d2ffd820d67512267b08dfa7aad649ec039dc7d4d36b70c8d920dde0",
    minimumLevel: 0,
    maximumLevel: 18
});

//删
// cesiumIns.removeLayerByName('影像');

//查
//let layer = instance.getLayerByName('影像');

//显示和隐藏
layer.show = true;
yxzjLayer.show = false;
vecLayer.show = false;
//修改层级
layer.index = 2;

//地形
instance.setTerrain({
  url: 'https://tiles1.geovisearth.com/base/v1/terrain',
  token: 'ce9aca38d2ffd820d67512267b08dfa7aad649ec039dc7d4d36b70c8d920dde0'
});

//移除地形
// instance.clearTerrain();
